<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page import="com.turing.post.webservice.client.MerchantOper"%>
<%@page import="com.turing.selfwebservice.common.Toolkit"%>
<%@page import="com.turing.selfwebservice.util.DateUtil"%>
<%@page import="com.turing.post.webservice.client.CardHolderUser"%>
<%@page import="com.turing.post.webservice.client.IdType"%>

<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<base href="<%=basePath%>"/>
		<title>用户关联卡信息</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<link href="<%=path %>/css/c.css" rel="stylesheet" type="text/css" />
		<link href="<%=path %>/js/plugs/fancybox/jquery.fancybox-1.3.4.css" rel="stylesheet" type="text/css" />
		<script>
var basePath = "<%=basePath%>";
</script>
		<script type="text/javascript" src="<%=path %>/js/jquery.js"></script>
		<script type="text/javascript" src="<%=path %>/js/plugs/fancybox/jquery.fancybox-1.3.4.pack.js"></script>
		<script type="text/javascript" src="<%=path %>/cardholderuser/cardholderuser.js"></script>
		
		<script type="text/javascript" src="<%=path %>/js/plugs/Validform_v5.3_min.js"></script>
		
		<script type="text/javascript" src="<%=path %>/js/common.js"></script>
		<script type="text/javascript" src="<%=path %>/js/cardHolderUserInfo.js"></script>
		
		<link href="css/" rel="stylesheet" type="text/css" /><link />
	</head>
	<%
		CardHolderUser cardholderuser = (CardHolderUser) request
				.getAttribute("CardHolderUser");
		List idTypeList = (ArrayList) request.getAttribute("idTypeList");
	%>
	<%
		String username = "";
		CardHolderUser holderUser = (CardHolderUser) session
				.getAttribute("CardHolderUser");
		List<IdType> IdTypeList=(List<IdType>)request.getAttribute("IdTypeList");
		if (holderUser != null) {
			username = holderUser.getLogonName();
		}
	%>

	<%
		Object obj = request.getAttribute("UpdateMsg");
		String UpdateMsg = obj == null ? "" : obj.toString();
		if (null != UpdateMsg && !"".equals(UpdateMsg)) {
	%>
	<script type="text/javascript">
		alert("<%=UpdateMsg%>");
		</script>
	<%
		}
	%>

	<body>
		<div align="right" class="optionDiv">
			<a fancyTo="updateCardHolderUserDiv" fancyOptions="width:490px;">修改持卡用户信息</a>
			<span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
			<a fancyTo="updateCardHolderPwdDiv" fancyOptions="width:350px;">修改持卡用户密码</a>
			<span>&nbsp;&nbsp;</span>
		</div>
		<table width="95%" border="1" align="center" cellpadding="0"
			cellspacing="0"> 
			<tr>
				<td colspan="4">
					持卡人基本信息
				</td>
			</tr>
			<tr>
				<td width="20%">
					登录名：
				</td>
				<td width="30%">
					<%=cardholderuser.getLogonName()%>
				</td>
				<td width="20%">
					姓名：
				</td>
				<td width="30%">
					<%=cardholderuser.getName()%>
				</td>
			</tr>
			<tr>
				<td width="20%">
					证件类型：
				</td>
				<td width="30%">
					<%=request.getAttribute("IdTypeName")%>
				</td>
				<td>
					上次修改密码时间：
				</td>
				<td>
					<%=DateUtil.getStringByXMLGregorianCalendar(cardholderuser
							.getLastPwdChangeTime())%>
				</td>
			</tr>
			<tr>
				<td width="20%">
					证件号码：
				</td>
				<td width="30%">
					<%=cardholderuser.getIdNo()%>
				</td>
				<td>
					性别：
				</td>
				<td>
					<%="1".equals(cardholderuser.getSex()) ? "男" : "0"
					.equals(cardholderuser.getSex()) ? "女" : "保密"%>
				</td>
			</tr>
			<tr>
				<td>
					联系电话：
				</td>
				<td>
					<%=Toolkit.dealNull(cardholderuser.getLinkTele())%>
				</td>
				<td>
					联系地址：
				</td>
				<td>
					<%=Toolkit.dealNull(cardholderuser.getAddr())%>
				</td>
			</tr>
			<tr>
				<td colspan="4">
					持卡人详细信息
				</td>
			</tr>
			<tr>
				<td>
					状态：
				</td>
				<td>
					<%="1".equals(cardholderuser.getStatus()) ? "启用" : "0"
					.equals(cardholderuser.getStatus()) ? "停用" : ""%>
				</td>
				<td>
					邮箱：
				</td>
				<td>
					<%=Toolkit.dealNull(cardholderuser.getEmail())%>
				</td>
			</tr>
			<tr>
				<td>
					备注：
				</td>
				<td colspan="3">
					<%=Toolkit.dealNull(cardholderuser.getRemark())%>
				</td>
			</tr>
		</table>
		
		
		<div id="hiddenDiv" style="display:none;">
		
		<div id="updateCardHolderUserDiv">
			<form method="post" id="UpdateCardHolderUserForm"  
				action="<%=basePath%>cardHolderUserServlet.do?method=UpdateCardHolderUserInfo">
				<table width="95%" border="1" align="center" cellpadding="0"
					cellspacing="0">
					<tr>
						<td colspan="2">
							<img src="<%=path%>/images/sign.png" />&nbsp;修改持卡用户信息
						</td>
					</tr>
					<tr>
						<td width="25%">
							姓名：
						</td>
						<td width="75%">
							<input type="text" name="cardusername" id="cardusername" style="width:160px"  datatype="*" errormsg="姓名不能为空!"
								value="<%=cardholderuser.getName()%>" />
						</td>
					</tr>
					<tr>
						<td>
							性别：
						</td>
						<td>
							<input id="man" name="sex" type="radio" value="1"
								<%="1".equals(cardholderuser.getSex()) ? "checked"
							: ""%> />
							<label for="man">
								男
							</label>
							<span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
							<input id="woman" name="sex" type="radio" value="0"
								<%="0".equals(cardholderuser.getSex()) ? "checked"
							: ""%> />
							<label for="woman">
								女
							</label>
						</td>
					</tr>
					<tr>
						<td>
							联系电话：
						</td>
						<td>
							<input type="text" name="linkTele" id="linkTele" style="width:160px"  datatype="m" errormsg="请输入手机号码!" ignore="ignore"
								value="<%=Toolkit.dealNull(cardholderuser.getLinkTele())%>" />
						</td>
					</tr>
					<tr>
						<td>
							安全问题1：
						</td>
						<td>
							<input type="text" name="question1" id="question1" style="width:160px"  datatype="*" errormsg="请填写安全问题!" ignore="ignore"
								value="<%=Toolkit.dealNull(cardholderuser.getQuestion1())%>" />
						</td>
					</tr>
					<tr>
						<td>
							安全问题答案1：
						</td>
						<td>
							<input type="text" name="answer1" id="answer1" style="width:160px"  datatype="*" errormsg="请填写问题答案!" ignore="ignore"
								value="<%=Toolkit.dealNull(cardholderuser.getAnswer1())%>" />
						</td>
					</tr>
					<tr>
						<td>
							安全问题2：
						</td>
						<td>
							<input type="text" name="question2" id="question2" style="width:160px"  datatype="*" errormsg="请填写安全问题!" ignore="ignore"
								value="<%=Toolkit.dealNull(cardholderuser.getQuestion2())%>" />
						</td>
					</tr>
					<tr>
						<td>
							安全问题答案2：
						</td>
						<td>
							<input type="text" name="answer2" id="answer2" style="width:160px"  datatype="*" errormsg="请填写问题答案!" ignore="ignore"
								value="<%=Toolkit.dealNull(cardholderuser.getAnswer2())%>" />
						</td>
					</tr>
					<tr>
						<td>
							安全问题3：
						</td>
						<td>
							<input type="text" name="question3" id="question3" style="width:160px"  datatype="*" errormsg="请填写安全问题!" ignore="ignore"
								value="<%=Toolkit.dealNull(cardholderuser.getQuestion3())%>" />
						</td>
					</tr>
					<tr>
						<td>
							安全问题答案3：
						</td>
						<td>
							<input type="text" name="answer3" id="answer3" style="width:160px"  datatype="*" errormsg="请填写问题答案!" ignore="ignore"
								value="<%=Toolkit.dealNull(cardholderuser.getAnswer3())%>" />
						</td>
					</tr>
					<tr>
						<td colspan="2" align="center">
							<input type="submit" name="button" id="button" value="提交" />
						</td>
					</tr>
				</table>
			</form>
		</div>
		
		<div id="updateCardHolderPwdDiv">
			<form method="post" id="UpdateCardHolderPwdForm"
				action="<%=basePath%>cardHolderUserServlet.do?method=UpdateCardHolderUserPwd" >
				<table width="95%" border="1" align="center" cellpadding="0"
					cellspacing="0">
					<td colspan="2" width="30%">
						<img src="<%=path%>/images/sign.png" />&nbsp;修改持卡用户密码
					</td>
					<tr>
						<td width="25%" nowrap class="labelTd"> 
							用户名：
						</td>
						<td width="75%" class="formTd" id=secTable>
							<input type="text" name="logonName" id="logonName" style="border:0px"
							 value="<%=username%>" readonly />
						</td>
					</tr>
					<tr>
						<td class="labelTd">
							旧密码:
						</td>
						<td class="formTd" id=secTable>
							<input type="password"  name="oldpassword" id="oldpassword"  datatype="*" errormsg="密码不能为空!"/>
						</td>
					</tr>
					<tr>
						<td class="labelTd">
							新密码:
						</td>
						<td class="formTd" id=secTable>
							<input type="password"  name="newpassword" id="newpassword" datatype="s6-30" errormsg="密码长度不够!"/>
						</td>
					</tr>
					<tr>
						<td class="labelTd">
							确认密码:
						</td>
						<td class="formTd" id=secTable>
							<input type="password" name="qrpassword" id="qrpassword" datatype="*" recheck="newpassword" nullmsg="请输入确认密码!"
									errormsg="输入的密码不一致!" />
						</td>
					</tr>
					<tr>
						<td colspan="2" align="center">
							<input type="submit" name="button" id="button" value="修改" />
						</td>
					</tr>
				</table>
			</form>
		</div>
		</div>
		
	</body>
</html>
